﻿{include file="/public/header" /}
<div class="content-wraper full">
    <div class="search_wraper" style="min-height: 51px;">
        <form class="normal_form search_form" onsubmit="return false;">
            <div class="condition" onscroll="Core.scrolling(this)">
                <div class="row inline-row" row-name="mydatetime">
                    <div class="field_text">结算日期：</div>
                    <div style="display: inline-block;vertical-align: top;">
                        <input type="text" name="sday" id="sday" data-options="seconds:false" date-type="sday" style="width:130px;" class="input-text date-ico" readonly="" value="{$Today ?? ''}" placeholder="请选择开始时间">
                    </div>
                </div>              
            </div>
            <div class="row form-footer-bar">
                <button class="btn" type="reset" role="btn-cancel">重置</button>
                <button r-button class="btn btn-primary search-btn" type="submit" role="btn-submit">搜索</button>
                <button r-button style="display: none;" class="btn switch_search filter">展开搜索条件<i class="fa fa-angle-down"></i></button>
                <div style="margin: 10px 0 -10px;"><a class="search_close"><i class="fa fa-angle-up"></i>收起</a></div>
            </div>
        </form>
    </div>
    <div class="table_box">
        <table class="table_main" id="datalist"></table>
    </div>
</div>
<script type="text/javascript">
Core.Easyui.FieldColumn = [
    {field:'kamount',title:'签到统计(元)',width:180,align:'center'},
    {field:'pamount',title:'员工缴费(元)',width:180,align:'center'},
    {field:'--',title:'详情',width:180,align:'center',formatter:function(value,row,index){
        return '<a href="{$_G["_mc_"] ?? ""}/info/channel/'+row.id+'/sday/'+row.sday+'">详情</a>';
    }},
    {field:'-',title:'',align:'center'},
];
Core.Easyui.FrozenColumn = [
    {field:'ck',checkbox:true,width:30},
    {field:'id',title:'ID',width:80,align:'center'},
	{field:'title',title:'门店名称',width:250,align:'left',search: true, nowsearch: false, searchtype: 'select', alias: 'channel'},
    {field:'sday',title:'结算日期',width:120,align:'center'},
];
Core.Easyui.init($("#datalist"), {
    url: "{$_G['_mc_'] ?? ''}/ajax",
    idField: "id",
    fitColumns: false,
    singleSelect : true,
    columns: [Core.Easyui.FieldColumn],
    frozenColumns: [Core.Easyui.FrozenColumn],
    pageSize: 50,
    onDblClickRow: function (index,row){
        Core.Sys.Action('pop',row);
    }
},$(".search_form"));
Core.Sys.Action = function(Tkey,row){
    switch(Tkey){
        case 'pop':
            if (!row || !row.id) return;
            window.location.href = "{$_G['_mc_'] ?? ''}/info/channel/"+row.id+"/sday/"+row.sday;
        break;
    }
    return;//unordertonet
}
/**搜索 */
var Table_Filters = Core.Search.searchArray();
var filterType = Core.Search.typeList();
//var rsourceUrl = "/index/ajax/index"; //搜索字段基础数据
//var regionUrl = "/index/ajax/district/level/"; //城市搜索字段
Core.Search.initFilter("/index.ajax/index",null);

$(document).ready(function(){
    $('.tools-bar').find('a[data-key]').on('click',function(){
        var Tkey = $(this).attr('data-key');
        if (!Core.rule('key',Tkey)) return false;
        Core.Sys.Action(Tkey);
    });
});
</script>
{include file="/public/footer" /}